#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTimer>
#include <QDateTime>
#include <QVector>
#include <QLineEdit>
#include <QTcpSocket>
#include "ad_value.h"
#include "photo_cap.h"
#include "data_transfer.h"
#include "movementdetection.h"
#include "qcustomplot.h"
#include "mylineedit.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = NULL);
    void setup_customplot(QCustomPlot *customPlot);
    ~MainWindow();

private slots:
    void update_R();
    void update_pic();
    void data_transfer_slot();
    void on_sb_ADC_Freq_valueChanged();

    void on_pb_login_clicked();


    void username_Clicked();

    void pw_Clicked();

    void on_kb_a_clicked();

    void on_kb_b_clicked();

    void on_kb_c_clicked();

    void on_kb_d_clicked();

    void on_kb_e_clicked();

    void on_kb_f_clicked();

    void on_kb_g_clicked();

    void on_kb_h_clicked();

    void on_kb_i_clicked();

    void on_kb_j_clicked();

    void on_kb_k_clicked();

    void on_kb_l_clicked();

    void on_kb_m_clicked();

    void on_kb_n_clicked();

    void on_kb_del_clicked();
    void timer_task();

    void on_pb_exit_clicked();

    void client_disconnected();

private:
    Ui::MainWindow *ui;
    AD_value ad;
    Camera camera;
    QTimer adc_timer, cap_timer, transfer_timer;
    int is_move;
    QImage imgbuffer_now;
    QImage imgbuffer_past;
    //QLineEdit *currentLine;
    int usr_or_pw;
    int history_lists;
    QTcpSocket client;
    bool serverConnected;
    QByteArray outBlock;
    Transfer data;
};
#endif // MAINWINDOW_H
